#!/bin/bash
#############
#Date 2022/6/8
#mail it-arch
#############
echo "##########################################"
echo "Auto Install vnc-gnome.                 ##"
echo "Press Ctrl + C to cancel                ##"
echo "Any key to continue                     ##"
echo "##########################################"
read -n 1
CONF=/etc/sysconfig/vncserver
service iptables stop
yum groupinstall -y "X Window System" "Desktop" "Chinese Support" 
yum -y install vnc vnc-server tigervnc-server* kdebase*
cat >$CONF<<EOF
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1200x950"
EOF
PASS=`date | md5sum |head -c 8`
echo "$PASS">vncpasswd.txt
vncpasswd <<EOF
$PASS
$PASS
EOF
chkconfig --add vncserver
#vncserver
chkconfig vncserver on
/etc/init.d/vncserver start
sleep 3
vncserver
echo "VNC is Install success! please see vncpasswd.txt"
